﻿#region Copyright 
/*-------------------------------------------------------------------------
* 命名空间名称/文件名:    SSPivot.AspNetCore.Repository/IRepository 
* CLR版本:     4.0.30319.42000
* 机器名称:    DESKTOP-NHMLO8A
* 功 能：       N/A
* 类 名：       IRepository
* 创建时间：  2025/5/22 14:35:57
* 版本号：      v1.0
* 创建人:        xulong
*-------------------------------------------------------------------------*/
#endregion
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.EntityFrameworkCore;
using SSPivot.Common; 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace SSPivot.AspNetCore.Repository
{
    public interface IRepository<TEntity> where TEntity : class
    {
        DbContext DbContext { get; set; }
        DbContext ReadDbContext { get; set; }
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="entity">待新增实体</param>
        /// <returns>新增后实体</returns>
        ValueTask<TEntity> AddNotCommitAsync(TEntity entity);

        /// <summary>
        /// 插入(立即提交到数据库)
        /// </summary>
        /// <param name="entity">待插入实体</param>
        /// <returns>插入后实体</returns>
        ValueTask<TEntity> AddAsync(TEntity entity);

        /// <summary>
		/// 批量新增
		/// </summary>
		/// <param name="entity">待新增实体</param>
		/// <returns>新增后实体</returns>
		Task AddRangeNotCommitAsync(IEnumerable<TEntity> entity);

        /// <summary>
        /// 批量插入(立即提交到数据库)
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task AddRangeAsync(IEnumerable<TEntity> entity);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">id</param>
        Task DeleteNotCommitAsync<TEntity>(TEntity id);

        /// <summary>
        /// 删除(立即提交到数据库)
        /// </summary>
        /// <param name="id">id</param>
        Task DeleteAsync<TEntity>(TEntity id);

        /// <summary>
        /// 删除(立即提交到数据库)
        /// </summary>
        /// <param name="entity">待删除的实体</param>
        Task DeleteAsync(TEntity entity);

        /// <summary>
        /// 删除多个(立即提交到数据库)
        /// </summary>
        /// <param name="entities">待删除的实体集合</param>
        Task DeleteRangeAsync(IEnumerable<TEntity> entities);

        /// <summary>
        /// 更新(立即提交到数据库)
        /// </summary>
        /// <param name="entity">待更新实体</param>
        /// <returns>更新实体</returns>
        ValueTask<TEntity> UpdateAsync(TEntity entity);

        /// <summary>
        /// 查找单个实体 (根据主键)
        /// </summary>
        /// <param name="id">id</param>
        /// <returns>查询到的结果</returns>
        ValueTask<TEntity> GetAsync(object id);

        /// <summary>
        /// 查找单个实体 (根据条件)
        /// </summary>
        /// <param name="predicate">条件</param>
        /// <returns>查询到的结果</returns>
        ValueTask<TEntity> GetAsync(Expression<Func<TEntity, bool>> predicate);



        #region noTracking
        /// <summary>
        /// 查询所有实体
        /// </summary>
        /// <returns></returns>
        IQueryable<TEntity> Query();

        /// <summary>
        /// 查询所有实体(有条件)
        /// </summary>
        /// <param name="predicate">条件</param>
        /// <returns>查询到的结果</returns>
        IQueryable<TEntity> Query(Expression<Func<TEntity, bool>> predicate);
        /// <summary>
        /// 查询所有实体并排序（单个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
        IQueryable<TEntity> Query<TKey>(Expression<Func<TEntity, TKey>> orderBy, SortType sortType);

        /// <summary>
        /// 查询所有实体并排序（单个排序字段）
        /// </summary>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
        IQueryable<TEntity> Query(string orderBy, SortType sortType);
        /// <summary>
        /// 查询所有实体并排序（多个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="orderBy"></param>
        /// <returns></returns>
        IQueryable<TEntity> Query<TKey>(Dictionary<Expression<Func<TEntity, TKey>>, SortType> orderBy);

        /// <summary>
        /// 查询所有实体并排序 (有条件)（单个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
        IQueryable<TEntity> Query<TKey>(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, TKey>> orderBy, SortType sortType);

        /// <summary>
        /// 查询所有实体并排序 (有条件)（单个排序字段）
        /// </summary>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
		IQueryable<TEntity> Query(Expression<Func<TEntity, bool>> predicate, string orderBy, SortType sortType);


        /// <summary>
        /// 查询所有实体并排序 (有条件)（多个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <returns></returns>
        IQueryable<TEntity> Query<TKey>(Expression<Func<TEntity, bool>> predicate, Dictionary<Expression<Func<TEntity, TKey>>, SortType> orderBy);

        /// <summary>
        /// 查询所有实体并排序 (单个排序字段)(分页)
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> Query<TKey>(Expression<Func<TEntity, TKey>> orderBy, SortType sortType, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (单个排序字段)(分页)
        /// </summary>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> Query(string orderBy, SortType sortType, IPageResult page);
        /// <summary>
        /// 查询所有实体并排序 (多个排序字段)(分页)
        /// </summary>
        /// <param name="page">分页信息</param>
        /// <param name="orderBy">排序</param>
        /// <returns>查询到的结果</returns>
        IQueryable<TEntity> Query<TKey>(Dictionary<Expression<Func<TEntity, TKey>>, SortType> orderBy, IPageResult page);
        /// <summary>
        /// 查询所有实体并排序 (有条件)(单个排序字段)(分页)
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> Query<TKey>(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, TKey>> orderBy, SortType sortType, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (有条件)(单个排序字段)(分页)
        /// </summary>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> Query(Expression<Func<TEntity, bool>> predicate, string orderBy, SortType sortType, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (有条件)(多个排序字段)(分页)
        /// </summary>
        /// <param name="predicate">条件</param>
        /// <param name="orderBy">排序</param>
        /// <param name="page">分页信息</param>
        /// <returns>查询到的结果</returns>
        IQueryable<TEntity> Query<TValue>(Expression<Func<TEntity, bool>> predicate, Dictionary<Expression<Func<TEntity, TValue>>, SortType> orderBy, IPageResult page);


        /// <summary>
        /// 查询所有实体
        /// </summary>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTracking();
        /// <summary>
		/// 查询所有实体(有条件)
		/// </summary>
		/// <param name="predicate">条件</param>
		/// <returns>查询到的结果</returns>
		IQueryable<TEntity> QueryNoTracking(Expression<Func<TEntity, bool>> predicate);


        /// <summary>
        /// 查询所有实体并排序（单个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTracking<TKey>(Expression<Func<TEntity, TKey>> orderBy, SortType sortType);

        /// <summary>
        /// 查询所有实体并排序（单个排序字段）
        /// </summary>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTracking(string orderBy, SortType sortType);

        /// <summary>
		/// 查询所有实体并排序（多个排序字段）
		/// </summary>
		/// <typeparam name="TKey"></typeparam>
		/// <param name="orderBy"></param>
		/// <returns></returns>
		IQueryable<TEntity> QueryNoTracking<TKey>(Dictionary<Expression<Func<TEntity, TKey>>, SortType> orderBy);

        /// <summary>
        /// 查询所有实体并排序 (有条件)（单个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTracking<TKey>(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, TKey>> orderBy, SortType sortType);
        /// <summary>
        /// 查询所有实体并排序 (有条件)（单个排序字段）
        /// </summary>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
		IQueryable<TEntity> QueryNoTracking(Expression<Func<TEntity, bool>> predicate, string orderBy, SortType sortType);

        /// <summary>
        /// 查询所有实体并排序 (有条件)（多个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <returns></returns>
		IQueryable<TEntity> QueryNoTracking<TKey>(Expression<Func<TEntity, bool>> predicate, Dictionary<Expression<Func<TEntity, TKey>>, SortType> orderBy);

        /// <summary>
        /// 查询所有实体并排序 (单个排序字段)(分页)
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTracking<TKey>(Expression<Func<TEntity, TKey>> orderBy, SortType sortType, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (单个排序字段)(分页)
        /// </summary>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTracking(string orderBy, SortType sortType, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (多个排序字段)(分页)
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="orderBy"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTracking<TKey>(Dictionary<Expression<Func<TEntity, TKey>>, SortType> orderBy, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (有条件)(单个排序字段)(分页)
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTracking<TKey>(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, TKey>> orderBy, SortType sortType, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (有条件)(单个排序字段)(分页)
        /// </summary>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTracking(Expression<Func<TEntity, bool>> predicate, string orderBy, SortType sortType, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (有条件)(多个排序字段)(分页)
        /// </summary>
        /// <param name="predicate">条件</param>
        /// <param name="orderBy">排序</param>
        /// <param name="page">分页信息</param>
        /// <returns>查询到的结果</returns>
        IQueryable<TEntity> QueryNoTracking<TValue>(Expression<Func<TEntity, bool>> predicate, Dictionary<Expression<Func<TEntity, TValue>>, SortType> orderBy, IPageResult page);
        #endregion
        #region ignorequeryfilter

        /// <summary>
        /// 查询所有实体
        /// </summary>
        /// <returns></returns>
        IQueryable<TEntity> QueryIgnoreQueryFilters();
        /// <summary>
        /// 查询所有实体(有条件)
        /// </summary>
        /// <param name="predicate">条件</param>
        /// <returns>查询到的结果</returns>
        IQueryable<TEntity> QueryIgnoreQueryFilters(Expression<Func<TEntity, bool>> predicate);
        /// <summary>
        /// 查询所有实体并排序（单个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryIgnoreQueryFilters<TKey>(Expression<Func<TEntity, TKey>> orderBy, SortType sortType);
        /// <summary>
        /// 查询所有实体并排序（单个排序字段）
        /// </summary>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryIgnoreQueryFilters(string orderBy, SortType sortType);
        /// <summary>
        /// 查询所有实体并排序（多个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="orderBy"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryIgnoreQueryFilters<TKey>(Dictionary<Expression<Func<TEntity, TKey>>, SortType> orderBy);

        /// <summary>
        /// 查询所有实体并排序 (有条件)（单个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryIgnoreQueryFilters<TKey>(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, TKey>> orderBy, SortType sortType);
        /// <summary>
        /// 查询所有实体并排序 (有条件)（单个排序字段）
        /// </summary>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryIgnoreQueryFilters(Expression<Func<TEntity, bool>> predicate, string orderBy, SortType sortType);

        /// <summary>
        /// 查询所有实体并排序 (有条件)（多个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryIgnoreQueryFilters<TKey>(Expression<Func<TEntity, bool>> predicate, Dictionary<Expression<Func<TEntity, TKey>>, SortType> orderBy);

        /// <summary>
        /// 查询所有实体并排序 (单个排序字段)(分页)
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryIgnoreQueryFilters<TKey>(Expression<Func<TEntity, TKey>> orderBy, SortType sortType, IPageResult page);
        /// <summary>
        /// 查询所有实体并排序 (单个排序字段)(分页)
        /// </summary>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryIgnoreQueryFilters(string orderBy, SortType sortType, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (多个排序字段)(分页)
        /// </summary>
        /// <param name="page">分页信息</param>
        /// <param name="orderBy">排序</param>
        /// <returns>查询到的结果</returns>
        IQueryable<TEntity> QueryIgnoreQueryFilters<TKey>(Dictionary<Expression<Func<TEntity, TKey>>, SortType> orderBy, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (有条件)(单个排序字段)(分页)
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryIgnoreQueryFilters<TKey>(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, TKey>> orderBy, SortType sortType, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (有条件)(单个排序字段)(分页)
        /// </summary>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryIgnoreQueryFilters(Expression<Func<TEntity, bool>> predicate, string orderBy, SortType sortType, IPageResult page);


        /// <summary>
        /// 查询所有实体并排序 (有条件)(多个排序字段)(分页)
        /// </summary>
        /// <param name="predicate">条件</param>
        /// <param name="orderBy">排序</param>
        /// <param name="page">分页信息</param>
        /// <returns>查询到的结果</returns>
        IQueryable<TEntity> QueryIgnoreQueryFilters<TValue>(Expression<Func<TEntity, bool>> predicate, Dictionary<Expression<Func<TEntity, TValue>>, SortType> orderBy, IPageResult page);

        /// <summary>
        /// 查询所有实体
        /// </summary>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTrackingIgnoreQueryFilters();

        /// <summary>
        /// 查询所有实体(有条件)
        /// </summary>
        /// <param name="predicate">条件</param>
        /// <returns>查询到的结果</returns>
        IQueryable<TEntity> QueryNoTrackingIgnoreQueryFilters(Expression<Func<TEntity, bool>> predicate);

        /// <summary>
        /// 查询所有实体并排序（单个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTrackingIgnoreQueryFilters<TKey>(Expression<Func<TEntity, TKey>> orderBy, SortType sortType);

        /// <summary>
        /// 查询所有实体并排序（单个排序字段）
        /// </summary>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTrackingIgnoreQueryFilters(string orderBy, SortType sortType);

        /// <summary>
        /// 查询所有实体并排序（多个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="orderBy"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTrackingIgnoreQueryFilters<TKey>(Dictionary<Expression<Func<TEntity, TKey>>, SortType> orderBy);

        /// <summary>
        /// 查询所有实体并排序 (有条件)（单个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTrackingIgnoreQueryFilters<TKey>(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, TKey>> orderBy, SortType sortType);

        /// <summary>
        /// 查询所有实体并排序 (有条件)（单个排序字段）
        /// </summary>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTrackingIgnoreQueryFilters(Expression<Func<TEntity, bool>> predicate, string orderBy, SortType sortType);

        /// <summary>
        /// 查询所有实体并排序 (有条件)（多个排序字段）
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTrackingIgnoreQueryFilters<TKey>(Expression<Func<TEntity, bool>> predicate, Dictionary<Expression<Func<TEntity, TKey>>, SortType> orderBy);

        /// <summary>
        /// 查询所有实体并排序 (单个排序字段)(分页)
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTrackingIgnoreQueryFilters<TKey>(Expression<Func<TEntity, TKey>> orderBy, SortType sortType, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (单个排序字段)(分页)
        /// </summary>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTrackingIgnoreQueryFilters(string orderBy, SortType sortType, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (多个排序字段)(分页)
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="orderBy"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTrackingIgnoreQueryFilters<TKey>(Dictionary<Expression<Func<TEntity, TKey>>, SortType> orderBy, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (有条件)(单个排序字段)(分页)
        /// </summary>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTrackingIgnoreQueryFilters<TKey>(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, TKey>> orderBy, SortType sortType, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (有条件)(单个排序字段)(分页)
        /// </summary>
        /// <param name="predicate"></param>
        /// <param name="orderBy"></param>
        /// <param name="sortType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        IQueryable<TEntity> QueryNoTrackingIgnoreQueryFilters(Expression<Func<TEntity, bool>> predicate, string orderBy, SortType sortType, IPageResult page);

        /// <summary>
        /// 查询所有实体并排序 (有条件)(多个排序字段)(分页)
        /// </summary>
        /// <param name="predicate">条件</param>
        /// <param name="orderBy">排序</param>
        /// <param name="page">分页信息</param>
        /// <returns>查询到的结果</returns>
        IQueryable<TEntity> QueryNoTrackingIgnoreQueryFilters<TValue>(Expression<Func<TEntity, bool>> predicate, Dictionary<Expression<Func<TEntity, TValue>>, SortType> orderBy, IPageResult page);

        #endregion
        /// <summary>
        /// SQL语句查询
        /// </summary>
        /// <param name="query"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        IQueryable<T> SelectQuery<T>(string strSql, string[] parameters);
    }
}
